package edu.suda.xsap.controller;

import edu.suda.xsap.dto.CardTypeDto;
import edu.suda.xsap.service.CardTypeService;
import edu.suda.xsapadminutils.common.Result;
import edu.suda.xsapadminvo.CardTypeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/cardtype")
public class CardTypeController {
    @Autowired
    private CardTypeService cardTypeService;

    @PostMapping("/save")
    public Result save(@RequestBody CardTypeVO cardTypeVO) {
        return cardTypeService.save(cardTypeVO);
    }
    @PostMapping("/update")
    public Result update(@RequestBody CardTypeVO cardTypeVO) {
        return cardTypeService.update(cardTypeVO);
    }
    @GetMapping("/findAll")
    public List<CardTypeDto> findAll() {
        return cardTypeService.findAll();
    }

}
